<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>
	<body>
		<script>
			str = "http://www.runoob.com:80/html/html-tutorial.html";
			patt1 = /(\w+):\/\/([^/:]+)(:\d*)?([^# ]*)/;
			a = str.match(patt1);
			for (var i = 0; i < a.length; i++) {
				document.write(a[i]);
				document.write("<br>");
			}
		</script>
	</body>
</html>
